#分词，用于之后的词云图
import re
import pandas as pd
import jieba
def draw():
    data = pd.read_csv('data/data.csv')
    # 分词
    cut_text = list(data['正文'])
    new_text = []
    all_text = ''
    for str in cut_text:
        remove_chars = '[brp·’!"\#$%&\'()＃！（）*+,-./:;<=>?\@，：。?￥★、…．＞【】［］《》？“”‘’\[\\]^_`{|}~]+'
        str = re.sub(remove_chars, "", str)
        str.replace('br','').replace('p','')
        result = jieba.cut(str)
        a = ','.join(result).split(',')
        new_text.append(a)
    for s in new_text:
        for word in s:
            all_text+=word+' '

